package org.example.iocdemo.config;

import org.example.iocdemo.model.UserInfo;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class BeanConfig {
    @Bean({"u1","u2","u3"})
    public UserInfo userInfo(){
        UserInfo userInfo = new UserInfo();
        userInfo.setId(1);
        userInfo.setName("张三");
        userInfo.setAge(18);
        return userInfo;
    }
    @Bean
    public UserInfo userInfo1(){
        UserInfo userInfo = new UserInfo();
        userInfo.setId(2);
        userInfo.setName("李四");
        userInfo.setAge(19);
        return userInfo;
    }
}
